<?php

namespace App\Http\Requests\Api\Ucenter\User;

use App\Http\Requests\BaseRequest;

/**
 *
 * @authors generator
 * @date    2020-10-19 16:51:40
 */
class RegisterRequest extends BaseRequest
{
    /**
     * 返回参数验证规则.
     *
     * @return array
     */
    protected function rule(): array
    {
        return [
            // 手机号码
            'mobile' => ['rule' => 'required_without:email|string', 'default' => ''],
            // 电子邮箱
            'email' => ['rule' => 'required_without:mobile|email', 'default' => ''],
            // 登录密码
            'password' => ['rule' => 'required|string|min:6', 'default' => ''],
            // 重复密码
            'password_repeat' => ['rule' => 'required|string|min:6', 'default' => ''],
            // 验证码
            'code' => ['rule' => 'required|string|size:6'],
            // 国家id
            'country_id' => ['rule' => 'required|integer', 'default' => 1],
        ];

    }
}
